package guoanmaker.operator.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import guoanmaker.operator.business.model.OperatorCity;
import guoanmaker.operator.business.model.OperatorLoginBackground;
import guoanmaker.operator.business.service.OperatorLoginBackgroundServiceInterface;
import guoanmaker.operator.helper.common.AjaxJson;
import guoanmaker.operator.helper.common.abstractobj.ApiController;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping(ApiController.OPERATOR_BACKGROUND)
public class OperatorLoginBackgroundController {
	@Autowired
	private OperatorLoginBackgroundServiceInterface operatorLoginBackgroundServiceInterface;
	
 @ApiOperation(value = "登录背景图片", notes = "新增/修改登录背景图片")
    @PostMapping(value = "saveOperatorLoginBackground")
    public AjaxJson saveBackground(@RequestBody OperatorLoginBackground operatorLoginBackground) {
	 AjaxJson ajaxJson=new AjaxJson();
	 return ajaxJson.setSuccess(true).setStatus(200).setData(operatorLoginBackgroundServiceInterface.savebackground(operatorLoginBackground));
    }
 
 @ApiOperation(value = "根据Id查找登录背景图片", notes = "根据Id查登录背景图片")
 @RequestMapping(value = "/getLoginBackgroundById", method = RequestMethod.POST)
public AjaxJson getLoginBackgroundById(@RequestParam(value = "id") String id) {
	 AjaxJson ajaxJson=new AjaxJson();
	 return ajaxJson.setSuccess(true).setStatus(200).setData(operatorLoginBackgroundServiceInterface.getbackgroundById(id)
    		 );
 }
	
}
